package cn.com.headfree.qynj.controller;

import java.util.Date;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.com.headfree.base.controller.ExBaseController;
import cn.com.headfree.base.controller.ResultData;
import cn.com.headfree.qynj.service.IQynjService;
import feign.Param;

/**
 * 企业年金controller
 *
 * @author xuliang
 */
@Controller
@RequestMapping(value = "/qynj", produces = "application/json;charset=UTF-8")
public class QynjController extends ExBaseController {
	private static final Logger LOG = LogManager.getLogger(QynjController.class);
	@Autowired
	public IQynjService qynjService;
	@Value("${qynjxq_url}")
	private String qynjxqUrl;

	@RequestMapping(value = "/getDetailByErpNo")
	@ResponseBody
	public ResultData getDetailByErpNo(String idcard) {
		ResultData result = new ResultData();
		try {
			result = qynjService.getDetailByErpNo(idcard, qynjxqUrl);
		} catch (Exception e) {
			LOG.error("查询职工企业年金账户的详细信息失败！", e.getMessage());
		}
		return result;
	}
	
	@RequestMapping(value = "/getPersonalRunningWater")
	@ResponseBody
	public ResultData getPersonalRunningWater(String idcard,String createTime,int pageSize,int pageNum) {
		ResultData result = new ResultData();
		try {
			result = qynjService.getPersonalRunningWater(idcard, qynjxqUrl,createTime,pageSize,pageNum);
		} catch (Exception e) {
			LOG.error("查询职工企业年金账户的流水信息失败！", e.getMessage());
		}
		return result;
	}
}
